﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Problema2
{
    class Customer
    {
        private string nume;
        private Computer pc;

        public string Nume { get { return nume; } set { nume = Nume; } }
        public Computer PC { get {return pc;} set { pc = PC; } } 


        public Customer()
        {
            Console.WriteLine("Nume client:");
            nume=Console.ReadLine();

            Console.WriteLine("Tip calcultor: \n1.ServerComputer\n2.HomeComputer\n3.GamingComputer");
            int aux=Int32.Parse(Console.ReadLine());
            if (aux == 1)
                pc = new ServerComputer();
            else if (aux == 2)
                pc = new HomeComputer();
            else if (aux == 3)
                pc = new GamingComputer();
        }

        public Customer(string x)
        {
        }

        public Customer Clone()         // Prototype Pattern
        {
            Customer c1=new Customer("clona");
            c1.nume = this.Nume;
            if (this.PC.TIP == "home")
                c1.pc = new HomeComputer(this.PC.CPU, this.PC.RAM, this.PC.Monitor);
            else
                if (this.PC.TIP == "server")
                    c1.pc = new ServerComputer(this.PC.CPU, this.PC.RAM, this.PC.Monitor);
                else
                    c1.pc = new GamingComputer(this.PC.CPU, this.PC.RAM, this.PC.Monitor);
            /*c1.pc.RAM.Tip = this.PC.RAM.Tip;
            c1.pc.Monitor.Inch = this.PC.Monitor.Inch;*/
            return c1;
        }
    }
}
